﻿@model BusinessLayer.Employee

@{
    ViewBag.Title = "Create";
}

<div style="font-family: Arial">
    <h2>Create</h2>

    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)

        <fieldset>
            <legend>Employee</legend>

            <div class="editor-label">
                @Html.LabelFor(model => model.Name)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Name)
                @Html.ValidationMessageFor(model => model.Name)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Gender)
            </div>
            <div class="editor-field">
                @Html.DropDownList("Gender", new List<SelectListItem>
           {
               new SelectListItem{Text="Male",Value="Male"},
               new SelectListItem{Text="Female",Value="Female"}               
           }, "-- Select Gender --")
                @Html.ValidationMessageFor(model => model.Gender)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.City)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.City)
                @Html.ValidationMessageFor(model => model.City)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.DepartmentId)
            </div>
            <div class="editor-field">
                @Html.DropDownList("DepartmentId", new List<SelectListItem>
           {
               new SelectListItem{Text="IT",Value="1"},
               new SelectListItem{Text="HR",Value="2"},           
               new SelectListItem{Text="Payroll",Value="3"}               
           }, "-- Select Department --")
                @Html.ValidationMessageFor(model => model.DepartmentId)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.DateOfBirth)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.DateOfBirth)
                @Html.ValidationMessageFor(model => model.DateOfBirth)
            </div>

            <p>
                <input type="submit" value="Create" />
            </p>
        </fieldset>
    }

    <div>
        @Html.ActionLink("Back to List", "Index")
    </div>
</div>
